
enum SIZE {
    //% block="29*29"
    1,
    //% block="58*58"
    2
}

enum LINE {
    //% block="1"
    1,
    //% block="2"
    2,
    //% block="3"
    3,
    //% block="4"
    4
}

enum BTN {
    //% block="A"
    A,
    //% block="B"
    B,
    //% block="A+B"
    AB
}


//% color="#1ed76d" iconWidth=35 iconHeight=35
namespace bmp180 {
    
  
    //% block="GY-68气压温度模块初始化" blockType="command"
    export function inital(parameter: any, block: any) {
        //let width = parameter.WIDTH.code
        
        
        Generator.addInclude('wire', '#include <Wire.h>');
		Generator.addInclude('gy68', '#include "gy68.h"');
		Generator.addSetup("Wirebegin", "Wire.begin();", true);
		Generator.addSetup("bmp085Calibrations", "bmp085Calibration();");
		//Generator.addCode("void",Generator.ORDER_UNARY_POSTFIX);
		
       
      
    }

 
    //% block="读取温度值（°C） " blockType="reporter"
    export function getTemperature(parameter: any, block: any) {
         Generator.addCode("bmp085GetTemperature(bmp085ReadUT())");
        
    }

     //% block="读取气压值（mbar）" blockType="reporter"
     export function getPressure(parameter: any, block: any) {
       Generator.addCode("bmp085GetPressure(bmp085ReadUP())");
 
   }
    
	//% block="读取标准大气压值" blockType="reporter"
     export function getatm(parameter: any, block: any) {
       Generator.addCode("bmp085GetPressure(bmp085ReadUP()) / 101325.0f ");
 
   }
   
   //% block="读取海拔高度" blockType="reporter"
     export function getaltitude(parameter: any, block: any) {
       Generator.addCode("calcAltitude(bmp085GetPressure(bmp085ReadUP()))");
 
   }

    
    function replace(str :string) {
        return str.replace("+", "");
    }
    
}
